package com.zmn.brs.starter.support.aop;


import org.springframework.aop.support.StaticMethodMatcherPointcut;
import org.springframework.util.CollectionUtils;

import java.io.Serializable;
import java.lang.reflect.Method;

/**
 * 类描述：切入点
 *
 * @author xujie
 * @since 2021/03/12 14:24
 */
public class StaffOperateRecordPointcut extends StaticMethodMatcherPointcut implements Serializable {


    private StaffOperateRecordOperationSource operationSource;

    @Override
    public boolean matches(Method method, Class<?> targetClass) {

        return !CollectionUtils.isEmpty(operationSource.computeStaffOperateRecordOperations(method, targetClass));
    }

    void setStaffOperateRecordOperationSource(StaffOperateRecordOperationSource operationSource) {

        this.operationSource = operationSource;
    }
}
